package colbert.content.constructSys;

import java.util.Scanner;

public class Test {
    public static void main(String[] args) {
        JD[] jds = new JD[4];
        jds[0] = new Lamp("灯");
        jds[1] = new TV("电视");
        jds[2] = new Air("空调");
        jds[3] = new Curtain("窗帘");
        // 调用修改设备状态方法
        DeviceControl dc = new DeviceControl();

        Scanner sc = new Scanner(System.in);

        while (true) {
            String str = sc.next();
            switch (str){
                case "1":
                    dc.control(jds[0]);
                    break;
                case "2":
                    dc.control(jds[1]);
                    break;
                case "3":
                    dc.control(jds[2]);
                case "4":
                    dc.control(jds[3]);
                    break;
                case "esc":
                    System.out.println("退出成功");
                    System.exit(0);
                    break;
                    default:
                        System.out.println("输入错误");
            }
        }
    }
}
